package _binary_search;

/**
 * 1539. 第 k 个缺失的正整数
 */
public class No1539 {
    /**
     * 1. 暴力
     */
    public int findKthPositive(int[] arr, int k) {
        int num = 1;
        for (int i = 0; i < arr.length; num++) {
            if (arr[i] == num) i++;
            else k--;
            if (k == 0) return num;
        }
        return num + k - 1;
    }
}
